package Login;

public class Login {
    private String userName;
    private String passWord;

    public Login(String userName, String passWord) {
        this.userName = userName;
        this.passWord = passWord;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public boolean isUserName(String userName) throws UserNameException {
        if (!this.userName.equals(userName)) {
            throw new UserNameException("用户名错误");
        }

        return true;
    }

    public boolean isPassword(String passWord) throws PassWordException {
        if (!this.passWord.equals(passWord)) {
            throw new PassWordException("密码错误");
        }

        return true;
    }

}